/*
 * Project: JDiveLog: A Dive Logbook written in Java
 * File: GasBlendingSettings.java
 * 
 * @author Pascal Pellmont <jdivelog@pellmont.dyndns.org>
 * 
 * This file is part of JDiveLog.
 * JDiveLog is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.

 * JDiveLog is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.

 * You should have received a copy of the GNU General Public License
 * along with JDiveLog; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */
package scubalogbook.data.imports.jdivelog.model.gasblending;

import java.util.ArrayList;
import java.util.List;

/**
 * Settings from Gas Blending
 * 
 * @author Pascal Pellmont <jdivelog@pellmont.dyndns.org>
 */
public class GasBlendingSettings {
    
    private Double tankVolume;
    private Double currentPressure;
    private Double currentOxygen;
    private Double currentHelium;
    private Double plannedPressure;
    private Double plannedOxygen;
    private Double plannedHelium;
    private List<GasSource> gasSources;
    
    /**
     * @return Returns the currentHelium.
     */
    public Double getCurrentHelium() {
        return currentHelium;
    }
    /**
     * @param currentHelium The currentHelium to set.
     */
    public void setCurrentHelium(Double currentHelium) {
        this.currentHelium = currentHelium;
    }
    /**
     * @return Returns the currentOxygen.
     */
    public Double getCurrentOxygen() {
        return currentOxygen;
    }
    /**
     * @param currentOxygen The currentOxygen to set.
     */
    public void setCurrentOxygen(Double currentOxygen) {
        this.currentOxygen = currentOxygen;
    }
    /**
     * @return Returns the currentPressure.
     */
    public Double getCurrentPressure() {
        return currentPressure;
    }
    /**
     * @param currentPressure The currentPressure to set.
     */
    public void setCurrentPressure(Double currentPressure) {
        this.currentPressure = currentPressure;
    }
    /**
     * @return Returns the gasSources.
     */
    public List<GasSource> getGasSources() {
        if (gasSources == null) {
            gasSources = new ArrayList<GasSource>();
        }
        return gasSources;
    }
    /**
     * @param gasSources The gasSources to set.
     */
    public void setGasSources(List<GasSource> gasSources) {
        this.gasSources = gasSources;
    }
    /**
     * @param source the Gas Source to add.
     */
    public void addGasSource(GasSource source) {
        if (gasSources == null) {
            gasSources = new ArrayList<GasSource>();
        }
        gasSources.add(source);
    }
    /**
     * @return Returns the plannedHelium.
     */
    public Double getPlannedHelium() {
        return plannedHelium;
    }
    /**
     * @param plannedHelium The plannedHelium to set.
     */
    public void setPlannedHelium(Double plannedHelium) {
        this.plannedHelium = plannedHelium;
    }
    /**
     * @return Returns the plannedOxygen.
     */
    public Double getPlannedOxygen() {
        return plannedOxygen;
    }
    /**
     * @param plannedOxygen The plannedOxygen to set.
     */
    public void setPlannedOxygen(Double plannedOxygen) {
        this.plannedOxygen = plannedOxygen;
    }
    /**
     * @return Returns the plannedPressure.
     */
    public Double getPlannedPressure() {
        return plannedPressure;
    }
    /**
     * @param plannedPressure The plannedPressure to set.
     */
    public void setPlannedPressure(Double plannedPressure) {
        this.plannedPressure = plannedPressure;
    }
    /**
     * @return Returns the tankVolume.
     */
    public Double getTankVolume() {
        return tankVolume;
    }
    /**
     * @param tankVolume The tankVolume to set.
     */
    public void setTankVolume(Double tankVolume) {
        this.tankVolume = tankVolume;
    }
    
    @Override
    public String toString() {
        StringBuffer sb = new StringBuffer();
        sb.append("<GasBlendingSettings>");
        if (tankVolume != null) {
            sb.append("<tankVolume>");
            sb.append(tankVolume);
            sb.append("</tankVolume>");
        }
        if (currentPressure != null) {
            sb.append("<currentPressure>");
            sb.append(currentPressure);
            sb.append("</currentPressure>");
        }
        if (currentOxygen != null) {
            sb.append("<currentOxygen>");
            sb.append(currentOxygen);
            sb.append("</currentOxygen>");
        }
        if (currentHelium != null) {
            sb.append("<currentHelium>");
            sb.append(currentHelium);
            sb.append("</currentHelium>");
        }
        if (plannedPressure != null) {
            sb.append("<plannedPressure>");
            sb.append(plannedPressure);
            sb.append("</plannedPressure>");
        }
        if (plannedOxygen != null) {
            sb.append("<plannedOxygen>");
            sb.append(plannedOxygen);
            sb.append("</plannedOxygen>");
        }
        if (plannedHelium != null) {
            sb.append("<plannedHelium>");
            sb.append(plannedHelium);
            sb.append("</plannedHelium>");
        }
        if (gasSources != null) {
            sb.append("<gasSources>");
            for (GasSource gassource : gasSources) {
                sb.append(gassource.toString());
            }
            sb.append("</gasSources>");
        }
        sb.append("</GasBlendingSettings>");
        return sb.toString();
    }

}
